package com.wondertek.service.dto.sys.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.util.List;
import java.util.Set;

/**
 * @author xqs
 */
@Data
public class SysUserAddReq {

    /**
     * 用户头像地址
     */
    @Schema(name = "avatar",description = "用户头像地址")
    private String avatar;

    /**
     * 用户名
     */
    //@NotBlank(message = "用户名不能为空")
    @Schema(name = "username", description = "用户名")
    private String username;

    /**
     * 用户昵称
     */
    @Schema(name = "nickname",description = "用户昵称")
    @NotBlank(message = "user.name.not.null")
    @Length(min = 1, max = 30, message = "name.length")
    private String nickname;

    /**
     * 手机号
     */
    @NotBlank(message = "phone.not.null")
    @Schema(name = "mobile",description = "手机号")
    @Pattern(regexp = "^(\\+\\d{1,3})?(\\d{1,4}[- ]?)?\\d{7,13}$", message = "phone.pattern.error")
    private String mobile;

    /**
     * 邮箱
     */
    @Schema(name = "email",description = "邮箱")
    @NotBlank(message = "email.not.null")
    @Pattern(regexp = "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@"
            + "(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,7}$", message = "verify.email")
    private String email;

    /**
     * 密码
     */
    @NotBlank(message = "password.not.null")
    @Pattern(regexp = "^(?=.*[a-zA-Z])(?=.*\\d).{8,20}", message = "password.length")
    @Schema(name = "password", description = "密码")
    private String password;

    /**
     * 岗位
     */
    @Schema(name = "position",description = "岗位")
    private String position;

    /**
     * 角色ids
     */
    @Schema(name = "roleIds", description = "角色ids")
    private Set<String> roleIds ;

    /**
     * 部门ids
     */
    @Schema(name = "departIds", description = "部门ids")
    private Set<String> departIds ;

    /**
     * 说明
     */
    @Length(max = 200, message = "备注最多输入200个字符")
    @Schema(name = "description", description = "说明")
    private String description;

    /*
    * 站点id
    * */
    @Schema(name = "siteIds", description = "站点id")
    private List<String> siteIds;

    @Schema(name = "countryCode",description = "区号")
    private String countryCode;
}
